import java.io.*;

public class DataInputStream14 {
    public static void main(String[] args) throws IOException {

        // 写
        FileOutputStream fileOutputStream = new FileOutputStream("F:\\IdeaProjects\\MyJava230203\\day27\\dir\\5.txt");
        DataOutputStream dataOutputStream = new DataOutputStream(fileOutputStream);
        dataOutputStream.writeByte(98);
        dataOutputStream.writeInt(98);
        dataOutputStream.writeFloat(1.2f);
        dataOutputStream.writeBoolean(true);
        dataOutputStream.flush();
        dataOutputStream.close();

        // 读
        FileInputStream fileInputStream = new FileInputStream("F:\\IdeaProjects\\MyJava230203\\day27\\dir\\5.txt");
        DataInputStream dataInputStream = new DataInputStream(fileInputStream);
        int i = dataInputStream.readByte();
        int k = dataInputStream.readInt();
        float p = dataInputStream.readFloat();
        boolean b = dataInputStream.readBoolean();
        System.out.println(i);
        System.out.println(k);
        System.out.println(p);
        System.out.println(b);

    }
}
